﻿@model CloudStorageLight.Core.Web.BlobConfigurationVM

@{
    ViewBag.Title = "Configuration";
    Layout = "~/Views/Shared/_LayoutCloudStorage.cshtml";
}

<header class="nrm nlm">
    @Html.Partial("_CommonHeader")
</header>


    <div class="container">

        <table class="table">
            <thead>
                <tr>
                    <th style="width:200px;">@(CloudStorageLight.Core.Web.ViewMessages.MsgStorageType)</th>
                    <th>@(CloudStorageLight.Core.Web.ViewMessages.MsgDirePath)</th>
                </tr>
            </thead>
            <tbody>


                @for (int i = 0; i < Model.Items.Count; i++)
                {
                    <tr class="item-cont">
                        <td>
                            @(Model.Types.ContainsKey(Model.Items[i].BlobType) ? Model.Types[Model.Items[i].BlobType] : Model.Items[i].BlobType)
                        </td>
                        <td>
                            @Html.ActionLink(Model.Items[i].Path, "ConfigurationEdit", new { path = Model.Items[i].Path }, new { @class = "folderpath" })
                        </td>
                    </tr>
                }
                <tr>
                    <td colspan="2">
                        @Html.DropDownList("BlobTypeItem", Model.BlobTypeItems)
                        <input type="button" id="blobAddBtn" value="@(CloudStorageLight.Core.Web.ViewMessages.MsgAdd)" class="btn btn-default" />
                    </td>
                </tr>
            </tbody>
        </table>
    </div>

<script type="text/javascript">

    $(function () {
        $("#blobAddBtn").click(function () {
            window.location.href = "@Url.Action("ConfigurationEdit")" + "?command=New&BlobType=" + $("#BlobTypeItem").val();
        });
    });
</script>